<%--
  Created by IntelliJ IDEA.
  User: PC
  Date: 2025/4/9
  Time: 11:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>显示登录的用户信息</title>
</head>
<body>
    <br />
    <center>
        <h3>欢迎光临</h3>
    </center>
    <br /><br />
    <c:choose>
        <c:when test="${sessionScope.user==null}">
            <a href="${pageContext.request.contextPath}/login.jsp">用户登录</a>
        </c:when>
        <c:otherwise>
            欢迎你：${sessionScope.user.username}!
            <a href="${pageContext.request.contextPath}/LogoutServlet">注销</a>
        </c:otherwise>
    </c:choose>
    <br />
</body>
</html>
